import java.util.*;

public class PrimeFactors {
    public static void main (String[] args) {
        int n;
        Scanner read = new Scanner(System.in);
        // printing one line using user input from keyboard
        System.out.print("Enter a number to be factorized: ");
        n = read.nextInt();
        List<Integer> factors = generate(n);
        for(int elem : generate(n)) {
            System.out.print(elem + ", ");
        }
    }

    static List<Integer> generate(int n) {
        List<Integer> nums = new ArrayList<Integer>();
        for (int i = 2; i <= Math.ceil(Math.sqrt(n)); i++) {
            if (n % i == 0) {
                nums.add(i);
                n /= i;
            }
        }
        nums.add(n);
        return nums;
    }
}